﻿using LuShanTea.Service.Entities;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LuShanTea.Service.ModelConfig
{
    public class AreaConfig : EntityTypeConfiguration<Area>
    {
        public AreaConfig()
        {
            this.ToTable("T_Areas");

            HasRequired(a => a.City).WithMany().HasForeignKey(a => a.CityId).WillCascadeOnDelete(false);

            Property(a => a.Name).IsRequired().HasMaxLength(16);

        }
    }
}
